/*
 * JNILogger.h  0.4.0 / Nov 14, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef JNILOGGER_H
#define JNILOGGER_H

#include "Cute4jCommon.h"

// JNILogger Class. ------------------------------------------------------------

/*!
 * \brief Cute4j Logger Wrapper.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT JNILogger
{
public:
  static void logInfo(const char *message, const char *fileName,
                      int lineNumber);
  static void logInfo(const char *message);
  static void logWarning(const char *message, const char *fileName,
                         int lineNumber);
  static void logWarning(const char *message);
  static void logError(const char *message, const char *fileName,
                       int lineNumber);
  static void logError(const char *message);
public:
  static void initialize(JNIEnv *env, jclass cls);
private:
  static void log(int level, const char *message, const char *fileName,
                  int lineNumber);
private:
  static jclass sm_loggerClass;
  static jmethodID sm_logMID;
};

// JNILogger :: Macro Definitions. ---------------------------------------------

#define LOG_INFO(message) JNILogger::logInfo(message, __FILE__, __LINE__)
#define LOG_WARNING(message) JNILogger::logWarning(message, __FILE__, __LINE__)
#define LOG_ERROR(message) JNILogger::logError(message, __FILE__, __LINE__)

#endif // JNILOGGER_H
